package org.myspringframework.springboot001.controller;

import jakarta.annotation.Resource;
import org.myspringframework.springboot001.bean.User;
import org.myspringframework.springboot001.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fzy
 * @version 1.0
 * 创建时间：       2024-09-23 19:00
 */

@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("get/{id}")
    public User getUser(@PathVariable Integer id) {
        return userService.selectById(id);
    }
}
